﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace ATM
{
    public partial class BalanceInquiry : Form

    {
        int accountNumber;
        public BalanceInquiry(string accountNumber)
        {
            InitializeComponent();

            this.accountNumber = Convert.ToInt32(accountNumber);
        }

        private void label1_Click(object sender, EventArgs e)
        {

        }

        private void accountNo_TextChanged(object sender, EventArgs e)
        {

        }

        private void showBalanceButton_Click(object sender, EventArgs e)
        {
            try
            {
                AccountLogic user1 = new AccountLogic();
                MessageBox.Show("The Current Balance In Account " + this.accountNumber + " Is " + user1.GetBalance(this.accountNumber));
            }

            catch (Exception ex) {
                MessageBox.Show(ex.Message);
            
            }

            }

        private void BalanceInquiry_Load(object sender, EventArgs e)
        {

        }

        private void back_Click(object sender, EventArgs e)
        {
            string accNumber = Convert.ToString(accountNumber);
            inter_face inter = new inter_face(accNumber);
            inter.Show();
            this.Hide();
        }

        private void exit_Click(object sender, EventArgs e)
        {

            welcom w = new welcom();
            w.Show();
            this.Hide();
        }
    }
}
